package zhuoer.adv2;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectWrite {

	public static void main(String[] args) {
		try {
			ObjectOutputStream oout = new ObjectOutputStream(
					new FileOutputStream("e:/stu.obj"));
			Student s = new Student("蔡启明", 20, Sex.男);
			oout.writeObject(s);
			oout.close();
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}

}
